package com.dyj.applet.handler;

import com.dtflys.forest.annotation.*;
import com.dyj.applet.domain.query.*;
import com.dyj.applet.domain.vo.*;
import com.dyj.common.config.AgentConfiguration;
import com.dyj.common.domain.DySimpleResult;
import com.dyj.common.domain.query.BaseQuery;
import com.dyj.common.domain.query.BaseSubscriptionQuery;
import com.dyj.common.domain.query.DeveloperNotifyQuery;
import com.dyj.common.domain.vo.TextAntiDirtVo;
import com.dyj.common.interceptor.SubscriptionTokenInterceptor;

import java.util.List;

/**
 * 触达与营销->订阅消息
 */
public class NotificationSubscriptionHandler extends AbstractAppletHandler{

    public NotificationSubscriptionHandler(AgentConfiguration agentConfiguration) {
        super(agentConfiguration);
    }

    /**
     * 触达与营销->订阅消息->给用户发送订阅消息
     * @param body 给用户发送订阅消息请求值
     * @return
     */
    public DySimpleResult<Void> developerNotify(DeveloperNotifyQuery body){
        baseQuery(body);
        return getNotificationSubscriptionClient().developerNotify(body);
    }

    /**
     * 触达与营销->订阅消息->查询订阅消息模版库
     * @return
     */
    public DySimpleResult<QuerySubscriptionTplListVo> querySubscriptionTplList(QuerySubscriptionTplListQuery body){
        baseQuery(body);
        return getNotificationSubscriptionClient().querySubscriptionTplList(body, body.getCategoryIds(), body.getClassification(), body.getKeyword(), body.getPageNum(), body.getPageSize(), body.getTemplateType());

    }

    /**
     * 触达与营销->订阅消息->新建订阅消息模板
     * @param body 新建订阅消息模板请求值
     * @return
     */
    public DySimpleResult<Void> createSubscriptionTpl(CreateSubscriptionTplQuery body) {
        baseQuery(body);
        return getNotificationSubscriptionClient().createSubscriptionTpl(body);
    }

    /**
     * 触达与营销->订阅消息->查询小程序新建的订阅消息模板列表
     * @return
     */
    public DySimpleResult<QueryCreatedSubscriptionTplListVo> queryCreatedSubscriptionTplList(QueryCreatedSubscriptionTplListQuery body) {
        baseQuery(body);
        return getNotificationSubscriptionClient().queryCreatedSubscriptionTplList(body, body.getPageNum(), body.getPageSize(), body.getStatus());
    }

    /**
     * 触达与营销->订阅消息->添加模板
     * @param body 添加模板请求值
     * @return
     */
    public DySimpleResult<AddAppSubscriptionTplVo> addAppSubscriptionTpl(AddAppSubscriptionTplQuery body) {
        baseQuery(body);
        return getNotificationSubscriptionClient().addAppSubscriptionTpl(body);
    }


    /**
     * 触达与营销->订阅消息->查询小程序的模板列表
     * @return
     */
    public DySimpleResult<QueryAppSubscriptionTplListVo> queryAppSubscriptionTplList(QueryAppSubscriptionTplListQuery body) {
        baseQuery(body);
        return getNotificationSubscriptionClient().queryAppSubscriptionTplList(body, body.getCategoryIds(), body.getClassification(), body.getPageNum(), body.getPageSize());
    }

    /**
     * 触达与营销->订阅消息->删除已添加的模板
     * @param body 删除已添加的模板请求值
     * @return
     */
    public DySimpleResult<Void> deleteAppSubscriptionTpl(DeleteAppSubscriptionTplQuery body) {
        baseQuery(body);
        return getNotificationSubscriptionClient().deleteAppSubscriptionTpl(body);
    }

    /**
     * 触达与营销->订阅消息->查询用户模板订阅状态
     * @param body 查询用户模板订阅状态请求值
     * @return
     */
    public DySimpleResult<QueryUserSubscriptionStatusVo> queryUserSubscriptionStatus(QueryUserSubscriptionStatusQuery body) {
        baseQuery(body);
        return getNotificationSubscriptionClient().queryUserSubscriptionStatus(body);
    }
}
